package com.kancy.streamplus.properties;

import java.time.Duration;

/**
 * PollingMessageProperties
 *
 * @author kancy
 * @date 2020/3/22 15:03
 */
public class PollingMessageProperties {
    /**
     * 实际渠道名称 （交实际换机名称）
     */
    private String channelName;

    /**
     * 消息业务类型
     */
    private String messageType;

    /**
     * 消息处理器
     */
    private String messageHandler;
    /**
     * 最大重试次数（消息在MQ中轮询到最大重试次数就会被丢弃）
     */
    private Integer maxRetryTimes = -1;
    /**
     * 最大活跃时间 （消息在MQ中轮询到最大活跃时间就会被丢弃）
     */
    private Integer maxLiveTime = -1;

    /**
     * 延时,延时消费消息的时间
     */
    private Duration delay = Duration.ofSeconds(0);

    /**
     * 频率 （与重试次数进行匹配）
     * PT8S,PT35S,PT65S
     */
    private String frequency = Duration.ofSeconds(0).toString();

    public String getChannelName() {
        return channelName;
    }

    public void setChannelName(String channelName) {
        this.channelName = channelName;
    }

    public String getMessageType() {
        return messageType;
    }

    public void setMessageType(String messageType) {
        this.messageType = messageType;
    }

    public String getMessageHandler() {
        return messageHandler;
    }

    public void setMessageHandler(String messageHandler) {
        this.messageHandler = messageHandler;
    }

    public Integer getMaxRetryTimes() {
        return maxRetryTimes;
    }

    public void setMaxRetryTimes(Integer maxRetryTimes) {
        this.maxRetryTimes = maxRetryTimes;
    }

    public Integer getMaxLiveTime() {
        return maxLiveTime;
    }

    public void setMaxLiveTime(Integer maxLiveTime) {
        this.maxLiveTime = maxLiveTime;
    }

    public String getFrequency() {
        return frequency;
    }

    public void setFrequency(String frequency) {
        this.frequency = frequency;
    }

    public Duration getDelay() {
        return delay;
    }

    public void setDelay(Duration delay) {
        this.delay = delay;
    }
}
